電気回路/z-turn/linux kernel のビルド
VirtualBox に Debian8 を新規インストール†
VirtualBox の作成†
必要なパッケージなどを洗い出すため、まっさらから始めてみます。
ビルドに linux の開発環境が必要なので、64bit Windows 10 上の Oracle VM VirtualBox に 32bit の Debian8 (Jessie) をインストールします。
Zynq 用の arm バイナリをコンパイルするのに 32 ビットライブラリが必要という情報があるようで、 たぶんコンパイル環境も 32 ビットのほうが都合が良いのかと思ったためです。
VirtualBox マネージャの [新規] から、Debian8new という 32bit Debian の VM を作成します。
- メモリ4G
- VDI形式の仮想ハードディスク可変型20G
としました。
インストールディスクのダウンロード&マウント†
https://www.debian.org/CD/netinst/
の i386 というリンクから、debian-8.7.1-i386-netinst.iso をダウンロード。
VirtualBox "Debian8new" を右クリックし、[設定] から [ストレージ] の [光学ディスクファイルを選択...] で上記 .iso ファイルをマウント
ネットワークの設定†
ホスト PC の Windows10 と、VirtualBox 内の Debian8 との間で通信を可能にするため ネットワークアダプタを追加します。
起動&インストール†
- [Install]
- Select Language => [Japanese]
- 場所の選択 => [日本]
- キーボードの設定 => [日本語]
- ネットワークの設定
- プライマリアダプタ => [eth0] (NATアダプタ)
- ホスト名 => [debian8new]
- ドメイン名 => []
- root のパスワード => [********]
- 新しいユーザー
- 本名 => [Osamu Takeuchi]
- ユーザ名 => [osamu]
- パスワード => [********]
- パーティショニング => [ディスク全体を使う] - [return] x 3 - [はい]
- アーカイブミラー => [日本]-[ftp.tsukuba.wide.ad.jp]-[]
- パッケージ利用調査に参加しますか => [はい]
- ソフトウェアの選択 => [SSHサーバ + 標準システムユーティリティ]
- GRUB ブートローダのインストール => [はい]-[/dev/sda]
- インストールの完了
vivado は Windows 上で使うつもりで、デスクトップ環境は入れませんでした。
インストールCDがアンマウントされていることを確認して続行すると再起動されます。
ログイン&必須パッケージのインストール†
etckeeper, sudo, jed の導入†
自動再起動後、コンソールからログインできることを確認し、
- /etc フォルダのバージョン管理をするため etckeeper を入れます。
- 設定ファイルの編集用に sudo および jed エディタを入れます。
- sudo グループに自分を追加します
$ export LANG=C
$ su
Password: (rootパスワードを入力)
# export LANG=C
# apt install etckeeper
The following extra packages will be installed:
git git-man liberror-perl rsync
Suggested packages:
sudo git-daemon-run git-daemon-sysvinit git-doc git-el git-email git-gui
gitk gitweb git-arch git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
etckeeper git git-man liberror-perl rsync
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 5065 kB of archives.
After this operation, 26.7 MB of additional disk space will be used.
Do you want to continue? [Y/n]
...
# apt install sudo jed
The following extra packages will be installed:
jed-common libonig2 libslang2-modules slsh
Suggested packages:
gpm
The following NEW packages will be installed:
jed jed-common libonig2 libslang2-modules slsh sudo
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 1892 kB of archives.
After this operation, 5984 kB of additional disk space will be used.
Do you want to continue? [Y/n]
...
# adduser osamu sudo
Adding user `osamu' to group `sudo' ...
Adding user osamu to group sudo
Done
# exit
$ sudo echo ok
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for osamu:
osamu is not in the sudoers file. This incident will be reported.
$ groups
osamu cdrom floppy audio dip video plugdev netdev bluetooth
$ groups osamu
osamu: osamu cdrom floppy sudo audio dip video plugdev netdev bluetooth
$ exit
一旦ログインしなおさないと、グループ設定は反映されないみたいだったので、 exit してログインしなおしました。
sshd on eth1†
以下、再ログイン後、
$ export LANG=C
$ groups
osamu cdrom floppy sudo audio dip video plugdev netdev bluetooth
$ sudo ifconfig
[sudo] password for osamu:
eth0 ...
...
lo ...
...
$ sudo jed /etc/network/interfaces
+ allow-hotplug eth1
+ iface eth1_inet dhcp
$ sudo service networking restart
$ sudo service networking restart # なぜか2回必要?
$ sudo ifconfig eth1
eth1 ...
inet addr:192.168.56.103
...
これでホスト PC から 192.168.56.103 というアドレスへ ssh 接続が可能になった
以下、PuTTY で ssh 接続して手順を続行します。
クロスコンパイル環境の整備†
ツールのインストール†
http://blog.kmckk.com/archives/4777624.html を見ながら
### 基本的な開発環境(git と make など)
$ sudo apt-get install git-core build-essential
### make menuconfig のため
$ sudo apt-get install ncurses-dev
### uImage を作成するため
$ sudo apt-get install u-boot-tools
2種類の arm アーキテクチャについて†
Debian の arm 用アーキテクチャは armel と armhf の2種類ある
https://www.debian.org/releases/stable/armel/release-notes/ch-whats-new.ja.html
- ARM EABI ('armel')
- ARMv7 (EABI 浮動小数点ハードウェア ABI, 'armhf')
https://japan.xilinx.com/support/documentation/data_sheets/j_ds190-Zynq-7000-Overview.pdf
*Zynq‐7000 All Programmable SoC
- ARM Cortex ‐ A9 ベース
-- ARMv7-A アーキテクチャ
-- 単精度および倍精度のベクター浮動小数点ユニット (VFPU)
浮動小数点付き ARMv7 に対応する armhf を使えば良さそう。
実機のアーキテクチャ名を確認†
z-turn 付属の SD カードから立ち上げて、
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5'
--with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6
--enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc
--enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-float=hard
--with-fpu=vfpv3-d16 --with-mode=thumb --disable-werror --enable-checking=release
--build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
$ uname -a
Linux localhost.localdomain 3.15.0-xilinx #9 SMP PREEMPT Tue May 26 17:26:14 CST 2015 armv7l armv7l armv7l GNU/Linux
armv7l とか armv7-a というアーキテクチャはどこで定義されているのだろう?
VirtualBox 上の linux-xlnx/ にて、
$ grep -s armv7l */*/*/*
tools/perf/jvmti/Makefile:ifeq ($(ARCH), armv7l)
$ grep -A5 armv7l tools/perf/jvmti/Makefile
ifeq ($(ARCH), armv7l)
JARCH=armhf
endif
ifeq ($(ARCH), armv6l)
JARCH=armhf
endif
ふむ、ARCH=armv7l としておくと、内部で armhf に置き換えられるみたい。
armv7l という単語は他には出てこなかった。
emdebian.org を apt のソースに指定†
以下、http://qiita.com/myahal@github/items/fc332e53713df244518f を見ながら クロスコンパイル用のツールチェインをインストールする
$ jed /etc/apt/sources.list.d/crosstools.list
+ deb http://emdebian.org/tools/debian/ jessie main
$ curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | sudo apt-key add -
-bash: curl: コマンドが見つかりません
gpg: 有効なOpenPGPデータが見つかりません。
$ sudo apt install curl
$ curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | sudo apt-key add -
armhf アーキテクチャのパッケージ一覧を読み込む†
$ sudo dpkg --add-architecture armhf
$ sudo apt-get update
crossbuild-essential-armhf をインストール†
$ sudo apt-get install crossbuild-essential-armhf
提案パッケージ:
binutils-doc gcc-4.9-locales binutils-multiarch gcc-4.9-doc libstdc++6-4.9-dbg:armhf libgcc1-dbg:armhf
libgomp1-dbg:armhf libitm1-dbg:armhf libatomic1-dbg:armhf libasan1-dbg:armhf liblsan0-dbg:armhf
libtsan0-dbg:armhf libubsan0-dbg:armhf libcilkrts5-dbg:armhf libquadmath-dbg:armhf glibc-doc:armhf locales:armhf
manpages-dev:armhf libstdc++-4.9-doc:armhf libyaml-shell-perl
$ arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc ( 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
適当なソースをコンパイル†
$ mkdir arm-hello
$ cd arm-hello
$ cat > hello.c
#include <stdio.h>
void main()
{
puts("Hello world!");
}
$ arm-linux-gnueabihf-gcc hello.c -o hello
$ file hello
a.out: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=94a2aefddb7ebe7a244405372693ca3758564470, not stripped
エミュレータで動かす†
$ sudo apt-get install qemu-user-static
$ qemu-arm-static ./hello
Hello world!
実機で動かす†
Windows 上で SD カードにコピーして z-turn board で動かす
Windows から見えるパーティションはブート領域で、 z-turn 上では /dev/mmcblk0p1 に来るので、 これをマウントしてホームにコピーし、実行する。
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk0 179:0 0 7.4G 0 disk
|-mmcblk0p1 179:1 0 64M 0 part
`-mmcblk0p2 179:2 0 7.4G 0 part /
mtdblock0 31:0 0 512K 0 disk
mtdblock1 31:1 0 128K 0 disk
mtdblock2 31:2 0 4.4M 0 disk
mtdblock3 31:3 0 4.5M 0 disk
mtdblock4 31:4 0 64K 0 disk
mtdblock5 31:5 0 6M 0 disk
mtdblock6 31:6 0 448K 0 disk
# mount /dev/mmcblk0p1 /media/BOOT
media-BOOT.mount
# cp -r /media/BOOT/arm-hello .
# cd arm-hello/
# file hello
hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=94a2aefddb7ebe7a244405372693ca3758564470, not stripped
# ./hello
Hello world!
ちゃんと動いた!
Xilinx Linux for Zynq AP SoC のビルド†
最新ソースファイルから uImage をビルドする。
uImage, zImage, vmlinuz の関係†
http://fowlrat.hatenablog.com/entry/2014/08/31/011056
http://aoking.hatenablog.jp/entry/2013/09/30/132325
uImage は zImage に
-A arm -O linux -C none -T kernel -a 0x40008000 -e 0x40008000 -n 'Linux-3.16.0'
といったヘッダ情報を付けたもの
zImage は vmlinux から .comment セクションの削除および、シンボルと再配置情報を落としたもの
vmlinux がカーネル自身
vmlinuz は vmlinux を gzip したものにヘッダ情報を追加したもの
uImage のビルド†
http://blog.kmckk.com/archives/4777624.html を見ながら
$ git clone https://github.com/Xilinx/linux-xlnx.git
$ git checkout xilinx-v2016.4
$ export CROSS_COMPILE=arm-linux-gnueabihf-
$ make ARCH=armv7l xilinx_zynq_defconfig
Makefile:531: arch/armv7l/Makefile: そのようなファイルやディレクトリはありません
make: *** No rule to make target 'arch/armv7l/Makefile'. 中止.
$ ls -d arch/arm*
arch/arm arch/arm64
どうやら armv7l を指定するのはここじゃないみたい。
$ make ARCH=arm xilinx_zynq_defconfig
$ make ARCH=arm menuconfig
メニュー形式でカーネル設定を変更可能
Device Drivers --->
Userspace I/O drivers --->
<*> Userspace I/O platform driver with generic IRQ handling
<*> Xilinx AXI Performance Monitor driver
を確認(初めからマークされているはず)
$ make ARCH=arm UIMAGE_LOADADDR=0x8000 uImage
...
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
UIMAGE arch/arm/boot/uImage
Image Name: Linux-4.6.0-xilinx
Created: Thu Feb 2 02:05:34 2017
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3848368 Bytes = 3758.17 kB = 3.67 MB
Load Address: 00008000
Entry Point: 00008000
Image arch/arm/boot/uImage is ready
$ ls -l arch/arm/boot/uImage
-rw-r--r-- 1 osamu osamu 3848432 2月 2 02:05 arch/arm/boot/uImage
$
modules もビルドする†
ファイル名が *.ko となっているのがカーネルモジュールの本体
$ make ARCH=arm modules
...
Building modules, stage 2.
MODPOST 23 modules
CC crypto/drbg.mod.o
LD [M] crypto/drbg.ko
CC crypto/echainiv.mod.o
LD [M] crypto/echainiv.ko
CC crypto/hmac.mod.o
LD [M] crypto/hmac.ko
CC crypto/jitterentropy_rng.mod.o
LD [M] crypto/jitterentropy_rng.ko
CC crypto/sha256_generic.mod.o
LD [M] crypto/sha256_generic.ko
CC drivers/remoteproc/mb_remoteproc.mod.o
LD [M] drivers/remoteproc/mb_remoteproc.ko
CC drivers/remoteproc/remoteproc.mod.o
LD [M] drivers/remoteproc/remoteproc.ko
CC drivers/remoteproc/zynq_remoteproc.mod.o
LD [M] drivers/remoteproc/zynq_remoteproc.ko
CC drivers/rpmsg/virtio_rpmsg_bus.mod.o
LD [M] drivers/rpmsg/virtio_rpmsg_bus.ko
CC drivers/usb/gadget/function/usb_f_mass_storage.mod.o
LD [M] drivers/usb/gadget/function/usb_f_mass_storage.ko
CC drivers/usb/gadget/function/usb_f_ss_lb.mod.o
LD [M] drivers/usb/gadget/function/usb_f_ss_lb.ko
CC drivers/usb/gadget/legacy/g_zero.mod.o
LD [M] drivers/usb/gadget/legacy/g_zero.ko
CC drivers/usb/gadget/libcomposite.mod.o
LD [M] drivers/usb/gadget/libcomposite.ko
CC drivers/virtio/virtio.mod.o
LD [M] drivers/virtio/virtio.ko
CC drivers/virtio/virtio_ring.mod.o
LD [M] drivers/virtio/virtio_ring.ko
CC fs/configfs/configfs.mod.o
LD [M] fs/configfs/configfs.ko
CC net/802/p8022.mod.o
LD [M] net/802/p8022.ko
CC net/802/psnap.mod.o
LD [M] net/802/psnap.ko
CC net/802/stp.mod.o
LD [M] net/802/stp.ko
CC net/8021q/8021q.mod.o
LD [M] net/8021q/8021q.ko
CC net/bridge/bridge.mod.o
LD [M] net/bridge/bridge.ko
CC net/ipv4/ipip.mod.o
LD [M] net/ipv4/ipip.ko
CC net/llc/llc.mod.o
LD [M] net/llc/llc.ko
$ ls modules*
modules.builtin modules.order
firmware はコンパイル必要ない?†
$ ls firmware
3com edgeport qlogic
Makefile emi26 r128
README.AddingFirmware emi62 radeon
WHENCE ess sb16
acenic ihex2fw.c sun
adaptec kaweth tehuti
advansys keyspan ti_3410.fw.ihex
atmsar11.HEX keyspan_pda ti_5052.fw.ihex
av7110 korg tigon
bnx2 matrox ttusb-budget
bnx2x modules.builtin vicam
built-in.o modules.order whiteheat.HEX
cis mts_cdma.fw.ihex whiteheat_loader.HEX
cpia2 mts_edge.fw.ihex whiteheat_loader_debug.HEX
cxgb3 mts_gsm.fw.ihex yam
dsp56k myricom yamaha
e100 ositech
すべて .ihex のようになっているけれど、make firmware_install というコマンドでインストールが可能みたい?
SD カードの構成†
uImage は BOOT 領域にコピーすればいいとして、modules はどうすれば?
実機から z-turn 付属の SD カードの構成を見てみる。
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk0 179:0 0 3.7G 0 disk
|-mmcblk0p1 179:1 0 196.1M 0 part /media/boot # SDカードのパーティション1
`-mmcblk0p2 179:2 0 3.5G 0 part / # SDカードのパーティション2
mtdblock0 31:0 0 512K 0 disk
mtdblock1 31:1 0 128K 0 disk
mtdblock2 31:2 0 4.4M 0 disk
mtdblock3 31:3 0 4.5M 0 disk
mtdblock4 31:4 0 64K 0 disk
mtdblock5 31:5 0 6M 0 disk
mtdblock6 31:6 0 448K 0 disk
# ls /media/boot/ # ここに uImage
7z010-hdmi.bit BOOT.bin uEnv-ramdisk.txt
7z010-lcd.bit System Volume Information uEnv-ubuntu.txt
7z010.bit devicetree-7ic.dtb uEnv.txt
7z020-hdmi.bit devicetree-hdmi-1080p.dtb uImage
7z020-lcd.bit devicetree-hdmi-720p.dtb uramdisk.image.gz
7z020.bit devicetree.dtb
# ls /lib/modules/3.15.0-xilinx/ # ここに modules.*
kernel/ modules.builtin modules.dep.bin modules.softdep
modules.alias modules.builtin.bin modules.devname modules.symbols
modules.alias.bin modules.dep modules.order modules.symbols.bin
# ls /lib/modules/3.15.0-xilinx/kernel/ # ここに *.ko
crypto/ drivers/ net/
# ls /lib/firmware # ここに *.fw
3com e100 keyspan_pda rtwifi ttusb-budget
av7110 edgeport korg sun whiteheat.fw
bnx2 emi26 mts_cdma.fw tehuti whiteheat_loader.fw
bnx2x emi62 mts_edge.fw ti_3410.fw yam
cpia2 ess mts_gsm.fw ti_5052.fw yamaha
cxgb3 kaweth rtl8192cufw_TMSC.bin tigon
インストールのため VirtualBox へ SD カードをマウントする†
Extention Pack のインストール†
SD カードは USB3.0 のカードリーダーで PC につないているのだけれど、 VirtualBox はそのままだと USB3.0 にアクセスできない。
VirtualBox からアクセスできるようにするため、 https://www.virtualbox.org/wiki/Downloads から落とした VirtualBox Extension Pack をダブルクリックし、VirtualBox を USB3.0 対応にした。
VirtualBox のハードウェア設定†
USBポートを 3.0 にする。
カードリーダーを VirtualBox に割り当てる†
VirtualBox 起動後に、USB 設定でカードリーダーを割り当てる。
インストール†
Makefile は
$ make help
...
modules_install - Install all modules to INSTALL_MOD_PATH (default: /)
firmware_install- Install all firmware to INSTALL_FW_PATH
(default: $(INSTALL_MOD_PATH)/lib/firmware)
..
となっている。
実際にモジュールがインストールされるのは
$(INSTALL_MOD_PATH)/lib/modules/$(VERSION)/
である。
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 19.1G 0 part /
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 880M 0 part [SWAP]
sdf 8:80 1 7.4G 0 disk
├─sdf1 8:81 1 64M 0 part
└─sdf2 8:82 1 7.4G 0 part
sr0 11:0 1 1024M 0 rom
$ sudo mkdir /mnt/sdcard1
$ sudo mkdir /mnt/sdcard2
$ sudo mount /dev/sdf1 /mnt/sdcard1
$ sudo mount /dev/sdf2 /mnt/sdcard2
$ ls /mnt/sdcard1
7z020.bit System Volume Information devicetree.dtb uImage
7z020b.bit arm-hello original uramdisk.image.gz
BOOT.bin devicetree-wo-uio.dtb uEnv.txt
$ sudo mv /mnt/sdcard1/uImage /mnt/sdcard1/uImage-orig
$ sudo cp arch/arm/boot/uImage /mnt/sdcard1
$ sudo umount /mnt/sdcard1
$ ls -l /mnt/lib/sdcard2/modules
合計 8
drwxrwxr-x 3 1002 1002 4096 5月 26 2015 3.15.0-xilinx
$ sudo make ARCH=arm INSTALL_MOD_PATH=/mnt/sdcard2 modules_install
INSTALL crypto/drbg.ko
INSTALL crypto/echainiv.ko
INSTALL crypto/hmac.ko
INSTALL crypto/jitterentropy_rng.ko
INSTALL crypto/sha256_generic.ko
INSTALL drivers/remoteproc/mb_remoteproc.ko
INSTALL drivers/remoteproc/remoteproc.ko
INSTALL drivers/remoteproc/zynq_remoteproc.ko
INSTALL drivers/rpmsg/virtio_rpmsg_bus.ko
INSTALL drivers/usb/gadget/function/usb_f_mass_storage.ko
INSTALL drivers/usb/gadget/function/usb_f_ss_lb.ko
INSTALL drivers/usb/gadget/legacy/g_zero.ko
INSTALL drivers/usb/gadget/libcomposite.ko
INSTALL drivers/virtio/virtio.ko
INSTALL drivers/virtio/virtio_ring.ko
INSTALL fs/configfs/configfs.ko
INSTALL net/802/p8022.ko
INSTALL net/802/psnap.ko
INSTALL net/802/stp.ko
INSTALL net/8021q/8021q.ko
INSTALL net/bridge/bridge.ko
INSTALL net/ipv4/ipip.ko
INSTALL net/llc/llc.ko
DEPMOD 4.6.0-xilinx
$ ls /mnt/sdcard2/lib/modules/4.6.0-xilinx/
build/ modules.alias.bin modules.dep modules.order modules.symbols.bin
kernel/ modules.builtin modules.dep.bin modules.softdep source/
modules.alias modules.builtin.bin modules.devname modules.symbols
$ ls /mnt/sdcard2/lib/firmware
3.2.0-1498-omap4 ipw2100-1.3-i.fw qat_895xcc_mmp.bin
3com ipw2100-1.3-p.fw qat_c3xxx.bin
GPL-3 ipw2100-1.3.fw qat_c3xxx_mmp.bin
Makefile ipw2200-bss.fw qat_c62x.bin
NPE-B ipw2200-ibss.fw qat_c62x_mmp.bin
NPE-C ipw2200-sniffer.fw qat_mmp.bin
README isci qca
RTL8192E iwlwifi-100-5.ucode qed
WHENCE.ubuntu iwlwifi-1000-5.ucode ql2100_fw.bin
acenic iwlwifi-105-6.ucode ql2200_fw.bin
adaptec iwlwifi-135-6.ucode ql2300_fw.bin
advansys iwlwifi-2000-6.ucode ql2322_fw.bin
...
$ sudo mv /mnt/sdcard2/lib/firmware /mnt/sdcard2/lib/firmware_3.15.0-xilinx
$ sudo make ARCH=arm INSTALL_MOD_PATH=/mnt/sdcard2 firmware_install
IHEX firmware/acenic/tg1.bin
INSTALL /mnt/sdcard2/lib/firmware/acenic/tg1.bin
IHEX firmware/acenic/tg2.bin
INSTALL /mnt/sdcard2/lib/firmware/acenic/tg2.bin
...
IHEX firmware/yam/1200.bin
INSTALL /mnt/sdcard2/lib/firmware/yam/1200.bin
IHEX firmware/yam/9600.bin
INSTALL /mnt/sdcard2/lib/firmware/yam/9600.bin
$ ls /mnt/sdcard2/lib/firmware
$ ls /mnt/sdcard2/lib/firmware
3com bnx2 e100 keyspan mts_gsm.fw sb16 ttusb-budget
acenic bnx2x edgeport keyspan_pda myricom sun vicam
adaptec cis emi26 korg ositech tehuti whiteheat.fw
advansys cpia2 emi62 matrox qlogic ti_3410.fw whiteheat_loader.fw
atmsar11.fw cxgb3 ess mts_cdma.fw r128 ti_5052.fw yam
av7110 dsp56k kaweth mts_edge.fw radeon tigon yamaha
$ sudo umount /mnt/sdcard1
$ sudo umount /mnt/sdcard2
起動してみる†
上記のようにインストールした SD カードを差してリセット。
...
reading uImage
3848432 bytes read in 249 ms (14.7 MiB/s)
reading devicetree.dtb
11172 bytes read in 15 ms (726.6 KiB/s)
## Booting kernel from Legacy Image at 02080000 ...
Image Name: Linux-4.6.0-xilinx
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3848368 Bytes = 3.7 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 02000000
Booting using the fdt blob at 0x2000000
Loading Kernel Image ... OK
Loading Device Tree to 1fffa000, end 1ffffba3 ... OK
Starting kernel ...
ここで止まってしまった。
そんなに単純な話ではないみたい。
z-turn board に付属の uImage だと、
...
reading uImage
3886152 bytes read in 257 ms (14.4 MiB/s)
reading devicetree.dtb
11172 bytes read in 15 ms (726.6 KiB/s)
## Booting kernel from Legacy Image at 02080000 ...
Image Name: Linux-3.15.0-xilinx
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3886088 Bytes = 3.7 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 02000000
Booting using the fdt blob at 0x2000000
Loading Kernel Image ... OK
Loading Device Tree to 1fffa000, end 1ffffba3 ... OK
Starting kernel ...
Booting Linux on physical CPU 0x0
Linux version 3.15.0-xilinx (tom@dev-server) (gcc version 4.6.1 (Sourcery CodeBench Lite 2011.09-50) ) #9 SMP PREEMPT Tue May 26 17:26:14 CST 2015
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: MYIR Z-turn Development Board
cma: CMA: reserved 128 MiB at 27800000
Memory policy: Data cache writealloc
PERCPU: Embedded 8 pages/cpu @e719c000 s9088 r8192 d15488 u32768
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 195088
のようになる。
ちゃんと調べなきゃ。
u-boot のビルド†
を見ながら
https://github.com/Xilinx/u-boot-xlnx
$ git clone https://github.com/Xilinx/u-boot-xlnx.git
Cloning into 'u-boot-xlnx'...
remote: Counting objects: 455718, done.
remote: Total 455718 (delta 0), reused 0 (delta 0), pack-reused 455718
Receiving objects: 100% (455718/455718), 114.43 MiB | 5.26 MiB/s, done.
Resolving deltas: 100% (364615/364615), done.
Checking connectivity... done.
$ ls
u-boot-xlnx/
$ cd u-boot-xlnx
$ git tag
..
xilinx-v2016.2
xilinx-v2016.3
xilinx-v2016.4
xilinx_microblaze
xilinx_pele_v2010.09
xilinx_pre_little_endian
zynq-beta-v2.2
$ git checkout xilinx-v2016.4
Note: checking out 'xilinx-v2016.4'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at 0b94ce5... ARM64: zynqmp: usb1 on zcu100 is not peripheral
$ export CROSS_COMPILE=arm-linux-gnueabihf-
まだ途中。







